import React from 'react';
import styles from './index.less';

import { connect } from 'umi'

type Props = {
  adminname: string
}
const IndexPage: React.FC<Props> = (props: Props) => {
  return (
    <div className={styles.box}>
      <h1 className={styles.title}>Page index {props.adminname}</h1>
    </div>
  );
}

export default connect(({ admin }: { admin: Props }) => {
  return {
    // 将数据映射到组件 props 中
    adminname: admin.adminname
  }
})(IndexPage)
